﻿@model SelfMadeMillionaire.Web.Infrastructure.ViewModels.MailingList.AdminSubscriberViewModel


<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td width="60%">
			<div class="form-group">
				@Html.LabelFor(m => m.FirstName, new { @class = "col-sm-4 control-label custom_label" })
				<div class="col-sm-8">
					@Html.TextBoxFor(m => m.FirstName, new { @class = "form-control" })
				</div>
			</div>
		</td>
		<td width="40%">
			<div class="form-group">
				<div class="col-sm-10 pull-right">
					<div class="checkbox">
						<label class="custom_label">
							@Html.CheckBoxFor(m => m.IsSMM) Self-Made Millionaire Newsletter									 
						</label>
					</div>
				</div>
			</div>
		</td>
	</tr>
	<tr>
		<td>
			<div class="form-group">
				@Html.LabelFor(m => m.LastName, new { @class = "col-sm-4 control-label custom_label" })
				<div class="col-sm-8">
					@Html.TextBoxFor(m => m.LastName, new { @class = "form-control" })
				</div>
			</div>
		</td>
		<td>
			<div class="form-group">
				<div class="col-sm-10 pull-right">
					<div class="checkbox">
						<label class="custom_label">
							@Html.CheckBoxFor(m => m.IsMMM) Maggie's Money Mountain Newsletter
						</label>
					</div>
				</div>
			</div>
		</td>
	</tr>
	<tr>
		<td>
			<div class="form-group">
				@Html.LabelFor(m => m.Email, new { @class = "col-sm-4 control-label custom_label" })
				<div class="col-sm-8">
					@Html.TextBoxFor(m => m.Email, new { @class = "form-control" })
				</div>
			</div>
		</td>
		<td>
			<div class="form-group">
				<div class="col-sm-10 pull-right">
					<div class="checkbox">
						<label class="custom_label">
							@Html.CheckBoxFor(m => m.TesterAccount) Tester Account
						</label>
					</div>
				</div>
			</div>
		</td>
	</tr>

</table>

<script type="text/javascript">
	$(function () {

	    $("input[type='submit']").click(function (e) {
			e.preventDefault();

			var form = $(this).closest("form");

			if ($(form).valid()) {
				$.ajax({
					url: $(form).attr("action"),
					type: "POST",
					data: form.serialize(),
					cache: false,
					success: function (result) {
					    if (result.success) {
					        $("#edit-modal-container").modal('hide');
					        refresh();
					    }
					    else
                            $("#edit-modal-container").html(result);
					}
				});
			}
		});

	});
</script>
